use clap::{App, Arg};
use rust_command::data::file_paser::FileParser;
use std::io::{Read, BufReader, BufRead};

fn main() {
    let matches = App::new("My rust command line")
        .version("0.1.0")
        .author("yoyo")
        .about("my personal command tool")
        .arg(Arg::new("file_id")
            .short('f')
            .long("file")
            .takes_value(true)
            .about("data file"))
        .get_matches();
    let path = matches.value_of("file_id").unwrap_or("./input.txt");
    let file_paser = FileParser::new(path);
    let file = file_paser.get_file();
    let buf_reader = BufReader::new(file);
    for line in buf_reader.lines() {
        println!("文件读取结果：{}", line.expect("读取失败！！！"))
    }

}




